import hashlib

def protect_model(model, license_key):
    """
    保护模型版权
    :param model: 模型
    :param license_key: 许可证密钥
    :return: 受保护的模型
    """
    model_hash = hashlib.sha256(model).hexdigest()
    if model_hash != license_key:
        raise ValueError("Unauthorized use")
    return model

# 示例
model = b"model_weights"
license_key = hashlib.sha256(model).hexdigest()
protected_model = protect_model(model, license_key)
print(f"Protected model: {protected_model}")